package ua.kpi.apolonov.factories;

import java.util.ArrayList;
import java.util.List;
import ua.kpi.apolonov.databases.StaticDatabase;
import ua.kpi.apolonov.questions.Question;

/**
 * Factory for the production questions from internal resources
 * @version 2.0 18.03.2013
 * @author Yegor Apolonov
 */

public class StaticQuestionsFactory extends QuestionsFactory {

	@Override
	public List<Question> retrieveQuestions() {
		List<Question> cloneQuestions = new ArrayList<Question>();
		try {
			for(Question question : new StaticDatabase()){
				cloneQuestions.add(question.clone());
			}
		} catch (CloneNotSupportedException e) {
			System.err.println(e);
		}
		return cloneQuestions;
	}
	
}
